﻿<%@ Page Title="" Language="C#" MasterPageFile="~/masterpagecuatui.Master" AutoEventWireup="true" CodeBehind="PartOfLesson.aspx.cs" Inherits="SQT.tracnghiem.PartOfLesson" %>

<%@ Import Namespace="DataAccess" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../Scripts/javacuatui4.js"></script>
    <title><%=title %> - Tiếng nhật thật dễ</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <%
        var get_lesson = new TblLessonController().FetchAll().Where(x => x.LessonId == this.lesson).Single();
    %>
    <div class="page-main-content">
        <header class="w3-row w3-padding w3-center w3-xlarge"><%=get_lesson.LessonTitle %></header>
        <div class="w3-row w3-margin-bottom">
            <div class="w3-col l2 w3-animate-left">
                <div class="w3-row w3-padding">
                    <div onclick="openpartoflesson(event,'Word')" class="lessonlink lesson-part w3-padding w3-center w3-card-2 w3-text-blue w3-hover-light-grey">
                        <i class="fa fa-language w3-xxxlarge"></i>
                        <br />
                        <span class="w3-large">Từ Vựng</span>
                    </div>
                </div>
                <div class="w3-row w3-padding">
                    <div onclick="openpartoflesson(event,'lp2')" class="lessonlink lesson-part w3-padding w3-center w3-card-2 w3-text-indigo w3-hover-light-grey">
                        <i class="fa fa-book w3-xxxlarge"></i>
                        <br />
                        <span class="w3-large">Ngữ Pháp</span>
                    </div>
                </div>
                <div class="w3-row w3-padding">
                    <div onclick="openpartoflesson(event,'lp3')" class="lessonlink lesson-part w3-padding w3-center w3-card-2 w3-text-orange w3-hover-light-grey">
                        <i class="fa fa-microphone w3-xxxlarge"></i>
                        <br />
                        <span class="w3-large">Luyện Đọc</span>
                    </div>
                </div>
                <div class="w3-row w3-padding">
                    <div onclick="openpartoflesson(event,'lp4')" class="lessonlink lesson-part w3-padding w3-center w3-card-2 w3-text-purple w3-hover-light-grey">
                        <i class="fa fa-volume-up w3-xxxlarge"></i>
                        <br />
                        <span class="w3-large">Luyện Nghe</span>
                    </div>
                </div>
                <div class="w3-row w3-padding">
                    <div onclick="openpartoflesson(event,'lp5')" class="lessonlink lesson-part w3-padding w3-center w3-card-2 w3-text-red w3-hover-light-grey">
                        <i class="fa fa-comments-o w3-xxxlarge"></i>
                        <br />
                        <span class="w3-large">Hội Thoại</span>
                    </div>
                </div>
                <div class="w3-row w3-padding">
                    <div onclick="openpartoflesson(event,'lp6')" class="lessonlink lesson-part w3-padding w3-center w3-card-2 w3-text-green w3-hover-light-grey">
                        <i class="fa fa-clock-o w3-xxxlarge"></i>
                        <br />
                        <span class="w3-large">Bài Tập</span>
                    </div>
                </div>
            </div>
            <div class="w3-threequarter w3-padding">
                <div id="Word" class="partoflesson w3-responsive w3-card-2">
                    <table id="sortable" class="w3-table w3-striped">
                        <thead>
                            <tr class="w3-blue">
                                <th>Mục từ</th>
                                <th>Hán Tự</th>
                                <th>Âm Hán</th>
                                <th>Nghĩa</th>
                                <th>Phát âm</th>
                            </tr>
                            <tr class="w3-light-grey">
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <td>&nbsp;</td>
                                <th class="w3-text-blue"><i onclick="speak_all()" title="Nghe tất cả" class="fa fa-play word-speak-all-btn w3-btn w3-blue w3-hover-white w3-hover-text-blue"></i></th>
                            </tr>
                        </thead>
                        <%
                            var get_word = new TblLessonWordController().FetchAll().Where(x => x.LessonId == get_lesson.LessonId);
                            foreach (TblLessonWord word in get_word)
                            {
                        %>
                        <tr>
                            <td><%=word.WordName %></td>
                            <td><%=word.WordChinese %></td>
                            <td><%=word.WordChineseMean %></td>
                            <td><%=word.WordVietNamMean %></td>
                            <%if (word.WordType == "")
                              { %>
                            <td>
                                <i title="Không có file âm thanh" class="fa fa-volume-up word-speak-btn w3-grey"></i>
                            </td>
                            <%}
                              else
                              { %>
                            <td class="word-speak-item">
                                <span class="word-speak-link w3-hide"><%=word.WordType %></span>
                                <i onclick="speak_one(this),pause_speak_all(this)" title="Nghe cách phát âm" class="fa fa-volume-up word-speak-btn w3-btn w3-blue w3-hover-white w3-hover-text-blue"></i>&nbsp;
                                    <i onclick="speak_all()" title="Dừng nghe tất cả" class="fa fa-play word-speak-all-btn inline-speak-all-btn w3-btn w3-blue w3-hover-white w3-hover-text-blue"></i>
                            </td>
                            <%} %>
                        </tr>
                        <%} %>
                    </table>
                    <div class="w3-hide">
                        <audio id="audio_player"></audio>
                    </div>
                </div>
                <div id="lp2" class="partoflesson w3-card-2 w3-padding">
                    <%
                        var get_grammar = from p in new TblLessonGrammarController().FetchAll().Where(x => x.LessonId == get_lesson.LessonId && x.GramActive == true) orderby p.GramIndex ascending select p;
                        foreach (TblLessonGrammar grammar in get_grammar)
                        {
                    %>
                    <div class="w3-row w3-border w3-margin-bottom">
                        <header class="grammar-name w3-row w3-padding w3-indigo">
                            <i class="muiten fa fa-chevron-down w3-right w3-padding-top"></i>
                            <span class="w3-large"><%=grammar.GramName %></span>
                        </header>
                        <div class="lesson-child-content w3-row w3-padding">
                            <div>
                                <label class="w3-border-bottom"><i class="fa fa-bookmark"></i>&nbsp;Cấu trúc</label>
                                <div class="w3-row w3-padding">
                                    <%=grammar.GramStructure %>
                                </div>
                            </div>
                            <div>
                                <label class="w3-border-bottom"><i class="fa fa-creative-commons"></i>&nbsp;Ý nghĩa</label>
                                <div class="w3-row w3-padding">
                                    <%=grammar.GramMean %>
                                </div>
                            </div>
                            <div>
                                <label class="w3-border-bottom"><i class="fa fa-lightbulb-o"></i>&nbsp;Cách sử dụng</label>
                                <div class="w3-row w3-padding">
                                    <%=grammar.GramUse %>
                                </div>
                            </div>
                            <div>
                                <label class="w3-border-bottom"><i class="fa fa-commenting-o"></i>&nbsp;Ví dụ</label>
                                <%
                            var get_grammar_example = new TblLessonGrammarExampleController().FetchAll().Where(x => x.GramId == grammar.GramId);
                            int i = 1;
                            foreach (TblLessonGrammarExample exam in get_grammar_example)
                            {
                                %>
                                <p><a data-toggle="tooltip" data-placement="bottom" title="<%=exam.ExamTrans %>" class="example-gram"><%=i %>) <%=exam.ExamName %></a></p>
                                <%i++;
                            } %>
                            </div>
                        </div>
                    </div>
                    <%} %>
                </div>
                <div id="lp3" class="partoflesson w3-card-2 w3-padding">
                    <%var get_read = new TblLessonReadingController().FetchAll().Where(x => x.LessonId == get_lesson.LessonId && x.ReadActive == true).ToList();%>
                    <div class="read-name w3-row w3-border w3-margin-bottom">
                        <div class="w3-hide read_id"><%=get_read[0].ReadId %></div>
                        <header class="read-name w3-row w3-padding w3-orange w3-text-white w3-large">
                            <i class="muiten fa fa-chevron-down w3-right"></i>
                            <span>文型（ぶんけい）</span>
                        </header>
                        <div class="lesson-child-content w3-padding">
                            <div class="w3-row">
                                <%=get_read[0].ReadContent %>
                            </div>
                        </div>
                    </div>
                    <div class="w3-row w3-border w3-margin-bottom">
                        <div class="w3-hide read_id"><%=get_read[1].ReadId %></div>
                        <header class="read-name w3-row w3-padding w3-orange w3-text-white w3-large">
                            <i class="muiten fa fa-chevron-down w3-right"></i>
                            <span>例文（れいぶん）</span>
                        </header>
                        <div class="lesson-child-content w3-padding">
                            <div class="w3-row">
                                <%=get_read[1].ReadContent %>
                            </div>
                        </div>
                    </div>
                </div>
                <%
                    var get_listen = new TblLessonListenController().FetchAll().Where(x => x.LessonId == get_lesson.LessonId && x.ListenActive == true);
                %>
                <div id="lp4" class="partoflesson w3-card-2">
                    <ul class="w3-navbar w3-black">
                        <%foreach (TblLessonListen listen in get_listen)
                          { %>
                        <li><a href="javascript:;" class="listenlink" onclick="openlisten(event, 'listen<%=listen.ListenId %>');"><%=listen.ListenName %></a></li>
                        <%} %>
                    </ul>
                    <%foreach (TblLessonListen listen in get_listen)
                      { %>
                    <div id="listen<%=listen.ListenId %>" class="hoithoai w3-padding w3-border listenpart" style="display: none">
                        <div class="w3-row w3-margin-top">
                            <div class="w3-row w3-padding">
                                <%=listen.ListenContent %>
                            </div>
                            <ul class="w3-ul">
                                <li>
                                    <div class="w3-row">
                                        <a class="themdoithoai-btn w3-text-red" style="cursor: pointer"><i class="fa fa-plus"></i>&nbsp;Hiển thị gợi ý</a><br />
                                        <div class="themvidu w3-threequarter" style="display: none">
                                            <%=listen.ListenResult %>
                                        </div>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <%} %>
                </div>
                <%
                    var get_talk1 = new TblLessonTalkingController().FetchAll().Where(x => x.TalkActive == true && x.LessonId == get_lesson.LessonId).Single();
                %>
                <div id="lp5" class="partoflesson w3-card-2">
                    <ul class="w3-navbar w3-black">
                        <li><a href="javascript:;" class="converlink w3-red" onclick="openconver(event, 'Talk1');">Bài hội thoại</a></li>
                        <li><a href="javascript:;" class="converlink" onclick="openconver(event, 'Talk2');">Mẫu hội thoại</a></li>
                        <li><a href="javascript:;" class="converlink" onclick="openconver(event, 'Talk3');">Bài học về văn hóa</a></li>
                    </ul>
                    <div id="Talk1" class="hoithoai w3-padding w3-border-red converpart">
                        <div class="w3-row w3-margin-top">
                            <%=get_talk1.TalkContent %>
                        </div>
                        <ul class="w3-ul">
                            <li>
                                <div class="w3-row">
                                    <a class="themdoithoai-btn w3-text-red" style="cursor: pointer"><i class="fa fa-plus"></i>&nbsp;Hiển thị gợi ý</a><br />
                                    <div class="themvidu w3-threequarter" style="display: none">
                                        <%=get_talk1.TalkResult %>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <div id="Talk2" class="hoithoai w3-padding w3-border-red converpart" style="display: none">
                        <%var get_talk2 = new TblLessonTalkingContentController().FetchAll().Where(x => x.TalkId == get_talk1.TalkId);  %>
                        <div id="Talk_little_area">
                            <%foreach (TblLessonTalkingContent talk in get_talk2)
                              { %>
                            <div class="w3-row w3-border w3-margin-bottom">
                                <header class="talk-name small-talk-name lesson-child-name w3-row w3-padding w3-red w3-large">
                                    <i class="muiten fa fa-chevron-down w3-right w3-padding-top"></i>
                                    <a class=" w3-text-white w3-half"><%=talk.TalkCtName %></a>
                                </header>
                                <div class="lesson-child-content w3-row w3-padding">
                                    <div class="w3-row w3-margin-top">
                                        <%=talk.TalkContent %>
                                    </div>
                                    <ul class="w3-ul">
                                        <li>
                                            <div class="w3-row">
                                                <a class="themdoithoai-btn w3-text-red" style="cursor: pointer"><i class="fa fa-plus"></i>&nbsp;Hiển thị gợi ý</a><br />
                                                <div class="themvidu" style="display: none">
                                                    <%=talk.TalkSub %>
                                                </div>
                                            </div>
                                        </li>
                                    </ul>
                                    <div class="w3-padding">
                                        <label class="w3-large w3-text-red">Luyện tập:</label>
                                    </div>
                                    <div class="w3-row">
                                        <%=talk.TalkTrainning %>
                                    </div>

                                </div>
                            </div>
                            <%} %>
                        </div>
                    </div>
                    <%var get_exam = new TblLessonExamController().FetchAll().Where(x => x.LessonId == get_lesson.LessonId && x.ExamActive == true); %>
                    <div id="Talk3" class="hoithoai w3-padding w3-border-red converpart" style="display: none">
                        <div class="w3-row w3-margin-top">
                            <%=get_talk1.TalkCultural %>
                        </div>
                    </div>
                </div>
                <div id="lp6" class="partoflesson w3-card-2 w3-padding">
                    <ul class="w3-navbar w3-black">
                        <%foreach (TblLessonExam exam in get_exam)
                          { %>
                        <li><a href="javascript:;" class="examlink" onclick="openexam(event, 'exam<%=exam.ExamId %>');"><%=exam.ExamName %></a></li>
                        <%} %>
                    </ul>
                    <%foreach (TblLessonExam exam in get_exam)
                      { %>
                    <div id="exam<%=exam.ExamId %>" class="hoithoai w3-padding w3-border exampart" style="display: none">
                        <div class="w3-row w3-margin-top">
                            <div class="w3-row w3-padding">
                                <%=exam.ExamQuestion %>
                            </div>
                            <ul class="w3-ul">
                                <li>
                                    <div class="w3-row">
                                        <a class="themdoithoai-btn w3-text-red" style="cursor: pointer"><i class="fa fa-plus"></i>&nbsp;Hiển thị gợi ý</a><br />
                                        <div class="themvidu w3-threequarter" style="display: none">
                                            <%=exam.ExamResult %>
                                        </div>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <%} %>
                </div>
            </div>
        </div>
    </div>
    <script>window.onload = hidepartoflesson();
    </script>
    <script src="../Scripts/word_speak.js"></script>
</asp:Content>
